#include <iostream>
#include <boost/asio.hpp>
#include "server.h"

int main(int argc, char* argv[]) {
    try {
        if (argc != 2) {
            std::cerr << "Usage: server <port>" << std::endl;
            return 1;
        }

        int port = std::atoi(argv[1]);

        boost::asio::io_context io_context;

        Server s(io_context, port);

        io_context.run();
    } catch (std::exception& e) {
        std::cerr << "Exception: " << e.what() << std::endl;
    }

    return 0;
}
